package ltd.service;


import com.googlecode.genericdao.search.Search;
import ltd.dao.SimulatorDao;
import ltd.entity.Simulator;
import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;

import javax.annotation.Resource;
import java.util.List;

@Service(value="simulatorService")
@Scope("singleton")
@Transactional(readOnly=true,propagation=Propagation.REQUIRED)
public class SimulatorService {

	@Resource
	private SimulatorDao simulatorDao;

//	@Transactional(readOnly=false, propagation=Propagation.REQUIRED)
//	public boolean save(GamesConfig gamesConfig) {
//		return this.simulatorDao.save(gamesConfig);
//	}

//	@Transactional(readOnly=false, propagation=Propagation.REQUIRED)
//	public boolean[] save(GamesConfig[] gamesConfigs) {
//		return this.simulatorDao.save(gamesConfigs);
//	}

//	@Transactional(readOnly=false, propagation=Propagation.REQUIRED)
//	public boolean remove(GamesConfig gamesConfig) {
//		return this.simulatorDao.remove(gamesConfig);
//	}

//	@Transactional(readOnly=false, propagation=Propagation.REQUIRED)
//	public void remove(GamesConfig[] gamesConfigs) {
//		this.simulatorDao.remove(gamesConfigs);
//	}

//	@Transactional(readOnly=false, propagation=Propagation.REQUIRED)
//	public boolean removeById(Integer id) {
//		return this.simulatorDao.removeById(id);
//	}

//	@Transactional(readOnly=false, propagation=Propagation.REQUIRED)
//	public void removeByIds(Integer[] ids) {
//		this.simulatorDao.removeByIds(ids);
//	}

//	public List<GamesConfig> findAll() {
//		return this.simulatorDao.findAll();
//	}

	public Simulator findById(Integer id) {
		return this.simulatorDao.find(id);
	}

//	public GamesConfig[] findByIds(Integer[] ids) {
//		return this.simulatorDao.find(ids);
//	}

	public int count(Search search) {
		return this.simulatorDao.count(search);
	}

	public List<Simulator> search(Search search) {
		return this.simulatorDao.search(search);
	}

	public Simulator searchOne(Search search) {
		return this.simulatorDao.searchUnique(search);
	}

	public void flush() {
		this.simulatorDao.flush();
	}
}
